xend: Remove _setSchedParams
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 5 Aug 2009 13:03:38 +0000 (14:03 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 5 Aug 2009 13:03:38 +0000 (14:03 +0100)
Currently, xc.sched_credit_domain_set is called twice when domains
are created.

start@XendDomainInfo
  _constructDomain
    xc.sched_credit_domain_set  --- 1st
  _initDomain
    _setSchedParams
      domain_sched_credit_set
        xc.sched_credit_domain_set  --- 2nd

resume@XendDomainInfo
  _constructDomain
    xc.sched_credit_domain_set  --- 1st
  _setSchedParams
    domain_sched_credit_set
      xc.sched_credit_domain_set  --- 2nd

This patch removes _setSchedParams method added by changeset 19955,
because xc.sched_credit_domain_set was added into _constructDomain
method by changeset 20006.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/python/xen/xend/XendConfig.py
tools/python/xen/xend/XendDomainInfo.py

index edb6a2fe32c74982f86c522f8e8aff63ed06ef84..7fd33b915906fb027155ed139c5ef0b75f655f31 100644 (file)
@@ -1055,10 +1055,7 @@ class XendConfig(dict):
         if domain.getDomid() is not None:
             sxpr.append(['domid', domain.getDomid()])
 
-        if legacy_only:
-            sxpr.append(['cpu_weight', int(self['vcpus_params'].get('weight', 256))])
-            sxpr.append(['cpu_cap', int(self['vcpus_params'].get('cap', 0))])
-        else:
+        if not legacy_only:
             for name, typ in XENAPI_CFG_TYPES.items():
                 if name in self and self[name] not in (None, []):
                     if typ == dict:
index 576a68490b12db47ac307cffacd329e3025737f8..020cecd4c6fec21cb3dc96fc7b4867d5fc87f4af 100644 (file)
@@ -484,7 +484,6 @@ class XendDomainInfo:
                     # we just ignore it so that the domain can still be restored
                     log.warn("Cannot restore CPU affinity")
 
-                self._setSchedParams()
                 self._storeVmDetails()
                 self._createChannels()
                 self._createDevices()
@@ -2572,12 +2571,6 @@ class XendDomainInfo:
                 for v in range(0, self.info['VCPUs_max']):
                     xc.vcpu_setaffinity(self.domid, v, cpumask)
 
-    def _setSchedParams(self):
-        if XendNode.instance().xenschedinfo() == 'credit':
-            from xen.xend import XendDomain
-            XendDomain.instance().domain_sched_credit_set(self.getDomid(),
-                                                          self.getWeight(),
-                                                          self.getCap())
 
     def _initDomain(self):
         log.debug('XendDomainInfo.initDomain: %s %s',
@@ -2594,9 +2587,6 @@ class XendDomainInfo:
             # distribution for NUMA systems.
             self._setCPUAffinity()
 
-            # Set scheduling parameters.
-            self._setSchedParams()
-
             # Use architecture- and image-specific calculations to determine
             # the various headrooms necessary, given the raw configured
             # values. maxmem, memory, and shadow are all in KiB.